package tm.controller;

import generator.domain.Stu;
import generator.service.StuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    private StuService userService;

    @GetMapping("/")
    public String index() {
        return "a";
    }

    /**
     * 查询所有用户
     * @return
     */
    @GetMapping("/users")
    public List<Stu> getUsers() {
        return userService.list();
    }

}
